HOME | PRODUCT | SHOP ONLINE | Sample Code | DOWNLOAD | SHIPPING | POLICY | CONTACT

1. Using Basic Stamp BS2 with SC4D Serial LED Display

'This program demostrates the features of SC4D using Basic Stamp 2
'Set SC4D to 9600bps (default)

'T9600  con   84,
'START_BYTE  con  254,
'STOP_BYTE  con  255
'serStr  VAR  Byte(10)
'second  VAR  Byte
'minute  VAR  Byte
'hour  VAR  Byte

Main:

serout  12,T9600,[START_BYTE,3,"1234",STOP_BYTE]    'This will display 1234 on LED
serout  12,T9600[START_BYTE,19,1,STOP_BYTE]    'This will turn on Decimal Point 1

PAUSE 5000

serout  12,T9600,[START_BYTE,1,16,0,30,12,STOP_BYTE]   'This will set the SC4D time to 12:30:00
PAUSE 5000
serout  12,T9600,[START_BYTE,247,STOP_BYTE] ' This cause SC4D to send its time information
GOSUB gettime

serout 12,T9600,[START_BYTE,3,"-HELP 911-",STOP_BYTE] ' You'll see -HELP 911- text scrolling on LED
PAUSE 60000

goto Main

gettime:
serin  11,T9600,[Str serStr\6]   'Receive 6 Bytes From SC4D
second = serStr(2)   ' Retrieve seconds information
minute = serStr(3)   'Retrieve minute information
hour = serStr(4)   ' Retrieve hour information
RETURN

2. Using Basic Stamp BS2 with SC1602 Serial LCD Display

BS2 to SC1602 Connection Diagram

 

   
 

Main | Shop | Download | Links | Webmaster

Copyright © SILICON CRAFT 2006